#include <stdio.h>
#include <string.h>
void insert(char s1[],char s2[],char sh)
{
    int c=-1,a=strlen(s1),b=strlen(s2);
    int i ; 
    for (i=0; i < a; i++)
    {
        if (s1[i]==sh)
        {
            c=i;
            break;
        }
    }
    if (c!=-1)
    {
        for ( i = a; i > c; i--)
            s1[i+b]=s1[i];
        for ( i = 0; i < b; i++)
            s1[c+1+i]=s2[i];
    }   
}

int main()
{
    char s1[256],s2[128];
    char ch;
    gets(s1);
    gets(s2);
    ch=getchar();
    insert(s1,s2,ch);
    puts(s1);
}
